﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace PosClient.Service
{
    public class DataUtil
    {

        public static Dictionary<string, MenuItems> MenuList = new Dictionary<string, MenuItems>()
        {
            {"UploadView", new MenuItems(){ Text = "上传数据", Tag = "UploadView", IconSvg ="<svg t=\"1738812795774\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2900\" width=\"128\" height=\"128\"><path d=\"M512 128a224 224 0 0 0-224 224v0.704A176 176 0 0 0 304 704H352v-64H304a112 112 0 1 1 0-224H352v-64a160 160 0 0 1 320 0v64h48a112 112 0 1 1 0 224H672v64h48a176 176 0 0 0 16-351.296V352a224 224 0 0 0-224-224z\" fill=\"#8997B2\" p-id=\"2901\"></path><path d=\"M370.752 557.248L416 602.496l64-64V896h64V538.496l64 64 45.248-45.248L512 416l-141.248 141.248z\" fill=\"#8997B2\" p-id=\"2902\"></path></svg>" } },
            {"ReportView", new MenuItems(){ Text = "报告", Tag = "ReportView", IconSvg = "<svg t=\"1738812696246\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2410\" width=\"128\" height=\"128\"><path d=\"M128 160h64v640h704v64H128V160z m640 544V288h64v416h-64z m-320 0V384h64v320h-64z m160 0v-256h64v256h-64zM288 704v-144h64V704H288z\" fill=\"#8997B2\" p-id=\"2411\"></path></svg>" } },
            {"MoreView", new MenuItems{ Text = "更多", Tag = "MoreView", IconSvg = "<svg t=\"1738812771775\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2574\" width=\"128\" height=\"128\"><path d=\"M192 192h288v288H192V192z m64 64v160h160V256H256zM544 192h288v288h-288V192z m64 64v160h160V256h-160zM192 544h288v288H192v-288z m64 64v160h160v-160H256zM544 544h288v288h-288v-288z m64 64v160h160v-160h-160z\" fill=\"#8997B2\" p-id=\"2575\"></path></svg>" } }
        };

        public static List<string> IconList = new List<string>()
        { 
            "",
            "",
            "",
            ""
        };

        public static Dictionary<string,string> PayIconList = new Dictionary<string, string>()
        {
            { "1",MoneyPay()},
            { "2",YstPay()},
            { "3",DepositPay()},
            { "4",TicketPay()},
            { "5",PointPay()},
            { "6",CardPay()},
            { "7",YsfPay()}
        };

        /// <summary>
        /// 微信支付宝
        /// </summary>
        /// <returns></returns>
        public static string YstPay()
        {
            return "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" t=\"1703843156827\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" p-id=\"27231\" width=\"200\" height=\"200\"><path d=\"M372.363467 615.982731H98.885773A99.490864 99.490864 0 0 1 0 517.096958V98.909511A99.490864 99.490864 0 0 1 98.885773 0.000465h419.793264a97.23341 97.23341 0 0 1 69.213059 28.671987 98.51341 98.51341 0 0 1 28.671987 69.608696V372.363933H488.727051a117.853037 117.853037 0 0 0-15.383266 1.000726c-18.827628-6.749088-39.074891-14.149812-60.206518-21.946171A535.41212 535.41212 0 0 0 465.454334 221.533456h-122.623944V178.129839h149.178114V154.019305H342.57439v-72.378149h-60.509064a10.635632 10.635632 0 0 0-10.612358 10.845086V155.927667H121.181036v24.017444h150.271932v42.193435H147.711933v24.110535H388.887096a420.375082 420.375082 0 0 1-34.257439 85.131597 595.129911 595.129911 0 0 0-176.267556-37.492346A155.647929 155.647929 0 0 0 139.6363 298.24033a127.697397 127.697397 0 0 0-68.235605 38.330164 104.727225 104.727225 0 0 0-16.034902 111.918495c19.572355 41.611617 65.512697 66.443606 122.879944 66.443606 70.050877 0 140.241391-38.167255 197.63191-107.450133 5.957815 2.90909 12.93963 6.260361 20.759264 9.93745A115.199948 115.199948 0 0 0 372.363467 488.727516v127.231942z m-205.242088-142.173026c-57.204338 0-87.365778-26.29817-96.535229-50.920704a59.415246 59.415246 0 0 1 19.386173-66.30397 119.621764 119.621764 0 0 1 60.276336-22.295263h0.488727a179.199919 179.199919 0 0 1 19.432718-1.047272c51.805067 0 102.28359 22.690899 153.739567 47.965069-48.639978 59.717791-104.331589 92.60214-156.788292 92.60214z\" fill=\"#1296DB\" p-id=\"27232\"/><path d=\"M930.908668 1024H488.727051a93.090867 93.090867 0 0 1-93.090867-93.090867V488.727516a93.090867 93.090867 0 0 1 93.090867-93.090867h442.181617a93.090867 93.090867 0 0 1 93.090867 93.090867v442.181617a93.090867 93.090867 0 0 1-93.090867 93.090867z m-221.090809-528.034669c-121.925763 0-221.090809 89.064687-221.090808 198.562819a190.836277 190.836277 0 0 0 83.78178 155.578111l-9.309087 54.318521s-1.652363 5.934543 0.535272 8.820359a4.351998 4.351998 0 0 0 3.700362 1.62909 17.012356 17.012356 0 0 0 6.818906-1.954908c11.287268-5.329452 41.309072-25.599988 53.713431-33.908348a241.338072 241.338072 0 0 0 81.454508 13.96363h0.395636c121.925763 0 221.090809-89.064687 221.090809-198.539546a180.317009 180.317009 0 0 0-23.133081-88.436324l-13.125812 8.122179c-65.02397 40.098891-217.297356 134.004303-237.38171 145.477752a32.581803 32.581803 0 0 1-15.546175 5.073452c-12.450903 0-14.824721-13.428358-14.847993-13.567994l-33.140349-79.290146c-3.816726-11.333813-4.654543-18.50181-2.699635-21.341081a3.281453 3.281453 0 0 1 2.839272-1.349818 24.017444 24.017444 0 0 1 10.914904 5.678543c0.209454 0.162909 20.596354 15.965084 35.933074 25.599989a35.258166 35.258166 0 0 0 18.990537 5.189816 43.450162 43.450162 0 0 0 14.173085-2.327272l216.855174-102.725772a229.887896 229.887896 0 0 0-180.9221-84.573052z\" fill=\"#3AC94F\" p-id=\"27233\"/></svg>";
        }
        /// <summary>
        /// 云闪付
        /// </summary>
        /// <returns></returns>
        public static string YsfPay()
        {
            return "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" t=\"1733389163722\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" p-id=\"2624\" width=\"128\" height=\"128\"><path d=\"M227.555556 0h568.888888c125.159602 0 227.555556 102.395953 227.555556 227.555556v568.888888c0 125.159602-102.40607 227.555556-227.555556 227.555556H227.555556C102.395953 1024 0 921.59393 0 796.444444V227.555556C0 102.395953 102.395953 0 227.555556 0z m8.589483 15.459047h551.720039c121.375778 0 220.685992 99.310214 220.685992 220.685992v551.720039c0 121.375778-99.310214 220.685992-220.685992 220.685992H236.145039c-121.375778 0-220.685992-99.310214-220.685992-220.685992V236.145039c0-121.375778 99.310214-220.685992 220.685992-220.685992z\" fill=\"#C54953\" p-id=\"2625\"/><path d=\"M236.145039 15.459047h551.720039c121.375778 0 220.685992 99.310214 220.685992 220.685992v401.27761c-301.876341 108.091924-629.187267 121.304958-993.092023-2.094256V236.145039c0-121.375778 99.310214-220.685992 220.685992-220.685992z\" fill=\"#FD2821\" p-id=\"2626\"/><path d=\"M1008.55107 637.412532v150.442429c0 121.375778-99.310214 220.685992-220.685992 220.685992H236.145039c-121.375778 0-220.685992-99.310214-220.685992-220.685992V635.318276c363.904756 123.399214 691.205564 110.18618 993.092023 2.094256z\" fill=\"#FEFEFE\" p-id=\"2627\"/><path d=\"M133.384868 209.000652h189.788132c12.049558 0 17.826467 5.776908 17.826466 17.826467 0 12.039441-5.776908 17.826467-17.826466 17.826466H133.384868c-12.049558 0-17.826467-5.787026-17.826467-17.826466 0-11.563934 5.776908-17.826467 17.826467-17.826467z m291.921038 60.692948v152.708676c0 12.049558-5.776908 17.826467-17.816349 17.826467-12.049558 0-17.826467-5.776908-17.826467-17.826467V269.6936c0-12.039441 5.776908-17.826467 17.826467-17.826467 12.039441 0 17.81635 6.262533 17.816349 17.826467z m346.351454 26.496887l49.614638 49.614639c8.194914 8.184797 8.194914 16.865335 0 25.050131-8.184797 8.194914-16.855218 8.194914-25.050131 0l-49.624756-49.614638c-8.184797-8.194914-8.184797-16.865335 0-25.050132 8.194914-8.670421 16.855218-8.670421 25.050131 0zM265.373565 492.726777h14.447329l-12.039441 64.061968c-0.961132 6.748157-0.485625 12.049558 2.893513 15.418578 2.893513 3.854645 7.223665 5.776908 13.000573 5.776908s11.078309-1.922264 15.418578-5.776908c4.330152-3.36902 7.223665-8.670421 8.670422-15.418578l11.563933-64.061968h14.44733l-12.525066 65.508724c-1.922264 10.602802-7.223665 18.787599-14.457447 24.564507-7.223665 6.262533-16.855218 9.631553-26.496887 9.631553-9.631553 0-17.340842-3.36902-22.642243-9.631553s-7.223665-14.447329-5.301401-24.564507l13.01069-65.508724z m77.072658 28.419151h13.971822l-1.446756 7.70929h0.485624c5.301401-5.301401 12.039441-8.184797 19.263106-8.184797 5.301401 0 10.602802 1.922264 14.457447 6.262533s5.291284 10.117177 3.854644 18.301974l-8.670421 46.731243h-13.971822l8.194914-41.915467c0.961132-4.815776 0.485625-8.670421-1.922264-11.078309-1.932381-2.407888-5.301401-3.854645-9.156046-3.854644s-7.709289 1.436639-10.602802 3.854644c-2.893513 2.407888-5.301401 6.262533-6.262532 11.078309l-8.184797 41.915467h-13.01069l13.01069-70.810125z m69.848993 0h13.486198l-13.486198 70.334618h-13.971822l13.971822-70.334618z m5.301401-28.419151h13.961705l-2.893513 14.447329h-13.971822l2.893513-14.447329z m13.486198 63.58646c1.446756-7.223665 2.893513-13.000573 4.815776-17.340842 1.932381-3.854645 4.340269-7.223665 7.709289-9.64167 2.893513-2.407888 5.776908-4.815776 9.156046-6.262533 4.340269-1.922264 8.670421-2.893513 13.486198-2.893513 5.301401 0 9.631553 0.961132 12.525065 2.893513 2.407888 1.446756 4.815776 3.854645 6.262533 6.262533 2.407888 2.893513 3.854645 6.262533 3.854645 9.64167 0.485625 3.844527 0 9.631553-1.446757 17.340842-1.446756 7.223665-2.893513 13.01069-4.815776 16.865335s-4.330152 7.223665-7.699172 10.117178c-0.961132 0.961132-2.407888 1.922264-3.854645 2.893512-1.446756 1.436639-3.36902 2.407888-4.815776 2.893513-4.340269 1.922264-9.156046 2.893513-13.971822 2.893513-5.301401 0-9.156046-0.961132-12.525066-2.893513-2.893513-1.446756-4.815776-3.36902-6.748157-5.776908-1.922264-2.893513-3.36902-6.262533-3.854645-10.117178 0-3.854645 0.485625-9.156046 1.932381-16.865335z m42.866481 0.485625c0.961132-3.854645 1.446756-7.223665 1.446756-11.07831 0-1.932381-0.475507-3.854645-1.446756-5.787025-0.961132-1.446756-1.932381-2.893513-3.854645-3.854645s-4.340269-1.436639-6.262533-1.436639c-2.407888 0-4.815776 0.485625-6.748157 1.436639-1.932381 0.961132-3.854645 1.932381-5.301401 3.854645-1.446756 1.932381-2.893513 3.854645-3.854645 5.787025-1.446756 3.36902-2.407888 7.223665-2.893513 11.07831-0.961132 3.36902-0.961132 7.223665-1.436639 10.602802 0 1.932381 0.485625 4.340269 1.436639 6.262533 0.961132 1.446756 2.407888 2.893513 3.854645 3.36902 1.932381 0.961132 3.854645 1.446756 6.262533 1.446756s4.815776-0.485625 6.748157-1.446756 3.854645-1.922264 5.301401-3.36902c1.922264-1.922264 2.893513-3.844527 3.854645-6.262533 1.446756-3.854645 1.922264-7.223665 2.893513-10.602802z m31.788171-35.642816h13.971822l-1.446756 7.709289h0.485624c5.301401-5.301401 12.039441-8.184797 19.263106-8.184797 5.301401 0 10.602802 1.922264 14.44733 6.262533 3.854645 4.340269 5.301401 10.117177 3.854644 18.301974l-8.670421 46.731243h-13.971822l8.194914-41.915466c0.961132-4.815776 0.485625-8.670421-1.932381-11.07831-1.922264-2.407888-5.301401-3.854645-9.156046-3.854644s-7.709289 1.436639-10.592684 3.854644c-2.893513 2.407888-5.301401 6.262533-6.262533 11.07831l-8.194914 41.915466h-13.961705l13.961705-70.810125z m75.625902-28.419152h35.167309c3.854645 0 7.223665 0.485625 10.592684 0.961132 3.854645 0.961132 6.748157 3.36902 9.631553 5.776908 2.893513 2.407888 4.815776 5.787026 5.776909 9.631553 1.446756 4.815776 1.446756 9.64167 0.485624 13.971822-1.446756 7.223665-5.301401 13.971822-11.563934 20.234355s-14.447329 9.631553-24.564507 9.631553h-22.166735l-7.223665 38.536329h-14.44733l18.301975-98.753769z m6.262533 46.245618h21.681111c5.301401 0 10.117177-1.932381 13.486197-5.301401 2.893513-2.893513 5.301401-6.748157 5.776909-11.078309 0.485625-2.893513 0.485625-5.776908 0-8.184797-0.485625-1.932381-1.922264-3.854645-3.854645-4.815776-2.893513-1.922264-6.262533-2.893513-10.117177-2.893513h-21.195487l-5.787026 32.273796z m90.083348 46.731243c-1.932381 2.407888-4.340269 4.340269-7.223665 5.291284-3.854645 1.446756-7.709289 1.932381-11.563934 1.932381-7.709289 0-13.01069-2.407888-16.37971-6.262533-3.854645-3.854645-4.815776-9.156046-3.854645-15.418579 0.961132-5.776908 3.854645-11.078309 8.670421-14.932954 4.330152-3.844527 10.592685-5.776908 17.81635-6.262532h19.273223l1.446756-7.223665c1.446756-6.262533-2.893513-9.145928-12.525065-9.145929-2.893513 0-5.776908 0.485625-8.194914 0.961132-2.407888 0.961132-4.330152 2.407888-5.776909 4.340269l-9.156045-8.670421c6.748157-7.223665 14.932954-10.602802 25.050131-10.117177 8.670421 0 15.418578 1.446756 19.748731 4.815776 4.340269 3.36902 5.787026 9.631553 4.340269 18.301974l-9.145929 48.167882h-13.971822l1.446757-5.776908z m4.815776-23.603375h-16.37971c-8.194914 0-12.525066 2.893513-13.486198 8.670421-0.485625 2.418005 0.485625 4.815776 1.922264 6.262533 1.446756 1.932381 4.815776 2.893513 9.156046 2.893513 5.776908 0 10.117177-0.485625 12.525065-1.932381s4.340269-4.815776 5.301401-10.117178l0.961132-5.776908z m26.011263-40.944217h14.932954l6.748158 49.614638h0.485624l25.525639-49.614638h14.932954l-45.759994 85.267571c-2.893513 5.301401-6.262533 9.145928-10.117177 11.07831s-7.709289 2.893513-12.049559 2.893513h-4.815776l2.407888-13.486198h3.854645c1.922264 0 3.854645-0.485625 5.301401-1.446756 1.932381-0.961132 3.36902-2.893513 4.340269-4.815777l6.262533-11.553817-12.039441-67.926729z m-4.340269-319.864683c10.602802 0 15.894086 5.301401 15.894086 15.904203v7.243899l-31.798289 32.668366v-39.902148c0-10.602802 5.301401-15.904203 15.904203-15.904203z m15.894086 26.071966v196.971328c0 10.592685-5.301401 15.894086-15.894086 15.894086s-15.904203-5.301401-15.904203-15.894086V260.031695l31.798289-32.658249z\" fill=\"#FFFFFF\" p-id=\"2628\"/><path d=\"M719.149209 199.369099c-7.223665-6.748157-18.301974-6.748157-25.050132 0.485625l-69.848993 71.295749v-42.390973c0-2.407888-0.475507-4.330152-1.436639-6.262533-1.932381-8.184797-9.145928-13.971822-17.340842-13.971822H439.277728l-8.184796-8.184797c-7.223665-6.748157-18.301974-6.748157-25.050132 0.485625-6.748157 7.223665-6.748157 18.301974 0.485625 25.050131l13.486197 13.000573c3.36902 3.36902 8.184797 5.301401 13.010691 4.815777h156.553204v63.58646l-13.971822 14.447329-49.139131-49.139131c-0.961132-0.961132-1.922264-1.922264-3.36902-2.407888-7.223665-6.748157-17.81635-6.748157-25.050132 0.485625l-62.625328 62.139704c-6.748157 6.748157-6.748157 18.301974 0 25.050131s18.301974 6.748157 25.050131 0l48.360108-48.360108-19.940956-20.042129 1.446756-1.436639 71.740905 72.125358c1.507459 1.284882 3.136325 2.296599 5.331753 3.025036 6.505345 3.470192 13.789713 2.640583 19.394629-1.770506l37.929298-38.971367v-0.212461l94.899125-97.307013c6.748157-7.223665 6.748157-18.301974-0.485624-25.525639zM589.092892 361.962258v39.730156c0 1.446756-0.961132 2.893513-1.932381 2.893513l-18.301974 0.485624c-9.631553 0-17.826467 8.194914-17.826466 17.826467s8.184797 17.826467 17.826466 17.826467l35.157192-0.485625h2.893513c9.631553 0 17.81635-8.194914 17.816349-17.826466v-97.054084l-35.642816 36.614065z m317.446678-124.05683h-14.932954v-25.050131c0-9.631553-8.184797-17.826467-17.81635-17.826467s-17.826467 8.194914-17.826467 17.826467v25.050131h-99.714901c-9.631553 0-17.81635 8.184797-17.816349 17.81635 0 9.64167 8.184797 17.826467 17.816349 17.826466h99.714901v131.988698c0 1.446756-0.961132 2.407888-1.93238 2.407888h-23.603375c-9.631553 0-17.81635 8.194914-17.81635 17.826466s8.184797 17.826467 17.81635 17.826467h43.362222c10.117177-1.446756 17.81635-10.117177 18.301974-20.709862V273.558361h14.932954c9.631553 0 17.826467-8.184797 17.826467-17.826466-0.485625-9.631553-8.670421-17.81635-18.301974-17.81635z m-717.753038 93.937993c0.485625-1.446756 0.961132-2.893513 0.961131-4.340269h150.290672c9.64167 0.485625 17.826467-7.709289 18.312091-17.340842s-7.709289-17.81635-17.340842-18.301974H117.490782c-9.631553-0.485625-17.826467 7.699172-18.301974 17.340842-0.485625 9.631553 7.699172 17.81635 17.340842 18.301974h35.157192l-32.759421 85.267571c-2.893513 7.709289 0 16.37971 6.748157 21.195487 3.36902 3.854645 8.184797 6.262533 13.486198 6.262533h189.312625c1.446756 0 2.893513 0 3.854644-0.485624 2.407888 0 4.330152 0 6.748158-0.961132 9.145928-3.36902 13.971822-13.486198 11.078309-22.642243l-19.263106-54.91604c-3.36902-9.156046-13.486198-13.971822-22.642243-11.078309-9.156046 3.36902-13.971822 13.486198-11.078309 22.642243l10.117177 28.904776c0 1.446756-0.961132 2.407888-1.922264 2.893513H164.222025c-1.436639 0-2.893513-1.446756-2.407889-2.893513v-0.961132l26.972396-68.877744z\" fill=\"#FFFFFF\" p-id=\"2629\"/><path d=\"M648.60213 767.306973H515.652301l-38.060822 179.681072h128.619678c6.262533 0 12.525066-5.776908 13.971822-13.01069l36.614065-154.155433c1.446756-6.73804-2.407888-12.525066-8.194914-12.525066z\" fill=\"#066B6A\" p-id=\"2630\"/><path d=\"M554.18863 767.306973H418.830913c-6.262533 0-12.525066 5.776908-13.971822 13.010691l-36.614066 154.155433c-1.446756 7.223665 1.932381 13.01069 8.194914 13.01069h139.697987l38.050704-180.166696z\" fill=\"#0A2F69\" p-id=\"2631\"/><path d=\"M478.077104 767.306973h-59.256308c-6.262533 0-12.525066 5.776908-13.971823 13.010691l-36.614065 154.155433c-1.446756 7.223665 1.932381 13.01069 8.194914 13.01069h64.072085l37.575197-180.166696z\" fill=\"#E41D21\" p-id=\"2632\"/></svg>";
        }
        /// <summary>
        /// 实体卡
        /// </summary>
        /// <returns></returns>
        public static string CardPay()
        {
            return "<svg t=\"1733713205340\" class=\"icon\" viewBox=\"0 0 1516 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3495\" width=\"128\" height=\"128\"><path d=\"M1516.556962 894.379747c0 71.291139-58.329114 129.620253-129.620253 129.620253H129.620253c-71.291139 0-129.620253-58.329114-129.620253-129.620253V129.620253C0 58.329114 58.329114 0 129.620253 0h1257.316456c71.291139 0 129.620253 58.329114 129.620253 129.620253v764.759494z\" fill=\"#D6DFE8\" p-id=\"3496\"></path><path d=\"M0 181.468354h1516.556962v226.835443H0z\" fill=\"#666666\" p-id=\"3497\"></path><path d=\"M181.468354 622.177215h615.696203v103.696203H181.468354z\" fill=\"#FFFFFF\" opacity=\".71\" p-id=\"3498\"></path><path d=\"M1059.64557 622.177215H1341.56962v200.911393h-281.92405z\" fill=\"#F06262\" p-id=\"3499\"></path></svg>";
        }
        /// <summary>
        /// 余额
        /// </summary>
        /// <returns></returns>
        public static string DepositPay()
        {
            return "<svg t=\"1733712786234\" class=\"icon\" viewBox=\"0 0 1139 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3156\" width=\"128\" height=\"128\"><path d=\"M1063.763847 1023.989882H78.601894C35.372623 1023.989882 0 988.617259 0 945.387988V248.3318c0-43.23433 35.372623-78.606953 78.601894-78.606953h985.161953\" fill=\"#567794\" p-id=\"3157\"></path><path d=\"M1139.750231 749.04767h-321.176537c-82.158381 0-149.387612-67.219114-149.387612-149.382553v-5.600328c0-82.16344 67.229232-149.387612 149.387612-149.387612h321.176537\" fill=\"#F06262\" p-id=\"3158\"></path><path d=\"M829.779409 596.857364m-74.691276 0a74.691277 74.691277 0 1 0 149.382553 0 74.691277 74.691277 0 1 0-149.382553 0Z\" fill=\"#FFFFFF\" p-id=\"3159\"></path><path d=\"M151.967709 0h817.475888v169.724847H151.967709z\" fill=\"#00CCC6\" p-id=\"3160\"></path><path d=\"M151.967709 118.78058h817.475888v50.944267H151.967709zM0 906.560058v38.82793c0 43.229271 35.372623 78.601894 78.601894 78.601894h985.161953v-117.429824H0z\" opacity=\".05\" p-id=\"3161\"></path></svg>";
        }
        /// <summary>
        /// 现金
        /// </summary>
        /// <returns></returns>
        public static string MoneyPay()
        {
            return "<svg t=\"1733712765496\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"29906\" width=\"128\" height=\"128\"><path d=\"M976.84 342.5h-920v648.28h932z\" fill=\"#A9E8A9\" p-id=\"29907\"></path><path d=\"M148.84 793.204c1.328-0.06 2.66-0.1 4-0.1 48.6 0 88 39.4 88 88 0 4.076-0.3 8.076-0.836 12H892.84v-452H240.46c0.24 2.636 0.38 5.3 0.38 8 0 48.6-39.4 88-88 88-1.34 0-2.672-0.044-4-0.1v256.2z\" fill=\"#66CC66\" p-id=\"29908\"></path><path d=\"M984.84 990.78l-928-408.84v-239.44h784l148 648.28z\" fill=\"#264C26\" opacity=\".23\" p-id=\"29909\"></path><path d=\"M252.192 595.18l299.188-554.08L987.16 305.956l1.68 684.824z\" fill=\"#A9E8A9\" p-id=\"29910\"></path><path d=\"M988.368 800.38a217.292 217.292 0 0 1-45.416-17.432c-90.624-46.984-131.944-147.076-92.288-223.56 25.516-49.22 78.348-76.624 136.916-77.428l-0.2-79.212-316.568-175.876c-24.208 39.404-73.472 55.324-115.98 37.968l-118.14 222.776c36.772 24.488 51.54 71.436 35.648 112.492l516.216 273.752-0.188-73.48z\" fill=\"#66CC66\" p-id=\"29911\"></path></svg>";
        }
        /// <summary>
        /// 优惠券
        /// </summary>
        /// <returns></returns>
        public static string TicketPay()
        {
            return "<svg t=\"1733725115999\" class=\"icon\" viewBox=\"0 0 1598 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3664\" width=\"128\" height=\"128\"><path d=\"M1532.865319 886.074032c-32.180636 0-58.518226-28.21213-58.518227-62.693621v-35.465782c0-34.481492 26.33759-62.693622 58.518227-62.693622 32.186905 0 58.505688-28.21213 58.505688-62.693621v-8.664259c0-34.481492-26.318782-62.693622-58.505688-62.693622-32.180636 0-58.518226-28.21213-58.518227-62.693621v-35.472051c0-34.481492 26.33759-62.693622 58.518227-62.693622 32.186905 0 58.505688-28.21213 58.505688-62.693622v-1.956041c0-34.481492-26.318782-62.693622-58.505688-62.693621-32.180636 0-58.518226-28.21213-58.518227-62.693622v-35.472051c0-34.481492 26.33759-62.693622 58.518227-62.693622 32.186905 0 58.505688-28.21213 58.505688-62.693621V62.693622c0-34.481492-28.21213-62.693622-62.693622-62.693622H62.693622c-34.481492 0-62.693622 28.21213-62.693622 62.693622v16.720389c0 34.481492 26.331321 62.693622 58.511957 62.693621s58.511957 28.21213 58.511957 62.693622v35.472051c0 34.481492-26.331321 62.693622-58.511957 62.693622s-58.511957 28.21213-58.511957 62.693621v1.956041c0 34.481492 26.331321 62.693622 58.511957 62.693622s58.511957 28.21213 58.511957 62.693622v35.472051c0 34.481492-26.331321 62.693622-58.511957 62.693621s-58.511957 28.21213-58.511957 62.693622v8.664259c0 34.481492 26.331321 62.693622 58.511957 62.693621s58.511957 28.21213 58.511957 62.693622v35.465782c0 34.481492-26.331321 62.693622-58.511957 62.693621s-58.511957 28.21213-58.511957 62.693622v12.538724c0 34.481492 28.21213 62.693622 62.693622 62.693622H1528.677385c34.481492 0 62.693622-28.21213 62.693622-62.693622v-12.538724c0-34.481492-26.33759-62.693622-58.505688-62.693622z\" fill=\"#00CCC6\" p-id=\"3665\"></path><path d=\"M552.964012 274.560447h485.442982v92.328896H552.964012zM629.544271 477.687781h332.276195v92.328896h-332.276195zM467.192869 690.043616h652.013665v92.335166h-652.013665z\" fill=\"#FFFFFF\" p-id=\"3666\"></path></svg>";
        }
        /// <summary>
        /// 积分
        /// </summary>
        /// <returns></returns>
        public static string PointPay()
        {
            return "<svg t=\"1733728805778\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"6488\" width=\"128\" height=\"128\"><path d=\"M512 0c282.88 0 512 229.12 512 512s-229.12 512-512 512-512-229.12-512-512 229.12-512 512-512z\" p-id=\"6489\" data-spm-anchor-id=\"a313x.search_index.0.i0.4a5f3a81Pj6MoH\" class=\"selected\" fill=\"#18b3d1\"></path><path d=\"M532.48 216.32S434.56 288 366.72 464.64c-25.6 1.28-78.08 10.24-149.12 58.88s-4.48 3.84-4.48 6.4c0 3.84 3.2 7.04 7.04 7.04 0 0 65.92 9.6 106.88 48.64-37.12 131.84-38.4 206.08-38.4 206.08 0 4.48 3.84 8.32 8.32 8.32 3.2 0 5.12-1.92 7.04-5.12h0.64c179.84-242.56 373.76-318.08 373.76-318.08a795.52 795.52 0 0 0-187.52 190.08c104.32 51.84 209.92 128 209.92 128 1.92 2.56 4.48 5.12 8.32 5.12 5.12 0 10.24-4.48 10.24-10.24-12.8-90.24-46.72-196.48-46.72-196.48 35.2-76.16 130.56-189.44 136.32-196.48l0.64-0.64h-1.28s1.92-3.2 1.92-5.12c0-4.48-3.84-8.32-8.32-8.32-1.28 0-1.92 0.64-2.56 1.28-247.04 24.96-414.72 200.32-414.72 200.32 69.12-131.2 206.08-197.12 206.08-197.12-19.2-120.32-41.6-165.12-41.6-165.12a9.664 9.664 0 0 0-9.6-8.32 9.6 9.6 0 0 0-7.04 2.56z\" fill=\"#FFFFFF\" p-id=\"6490\"></path></svg>";
        }

        public static bool CheckNetWorkConnection()
        {
            try
            {
                Ping ping = new Ping();
                string host = "www.baidu.com";
                byte[] buffer = new byte[32];
                int timeout = 10000;
                PingOptions pingOptions = new PingOptions();
                PingReply reply = ping.Send(host, timeout, buffer, pingOptions);
                return (reply.Status == IPStatus.Success);
            }
            catch (Exception)
            {
                return false;
            }
        }

        [DllImport("wininet.dll")]
        private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
        public static bool IsConnected()
        {

            bool state = InternetGetConnectedState(out int I, 0);

            return state;

        }

        public static string GetExceptionMsg(Exception ex, string backStr)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("<b>【门店】：</b>" + Globals.StoreCode + "-" + Globals.StoreName + "<br/>");
            sb.AppendLine("<b>【收银机】：</b>" + Globals.Pos + "<br/>");
            sb.AppendLine("<b>【发生时间】：</b>" + DateTime.Now.ToString() + "<br/>");
            if (ex != null)
            {
                sb.AppendLine("<b>【异常类型】：</b>" + ex.GetType().Name + "<br/>");
                sb.AppendLine("<b>【异常信息】：</b>" + ex.Message + "<br/>");
                if (ex.StackTrace != null)
                {
                    sb.AppendLine("<b>【堆栈调用】：</b>" + backStr + "<br/>");
                }
                else
                {
                    sb.Append("<b>【内部异常】：</b>" + ex.InnerException.ToString().Replace("\r\n", "<br/>").Replace("\n", "<br/>") + "<br/>");
                }

            }
            else
            {
                sb.AppendLine("<b>【未处理异常】：</b>" + backStr + "<br/>");
            }
            return sb.ToString();
        }
    }
    public class MenuItems
    {
        public string IconSvg { get; set; } = null;
        public string Text { get; set; } = string.Empty;
        public string Tag { get; set; } = null;
    }
}
